Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cql3 parser #598

Conversation

Claude-at-Instaclustr
Copy link
Contributor

@Claude-at-Instaclustr Claude-at-Instaclustr commented Apr 4, 2022

This is a merge of the CQL3 parser into the shotover-proxy codebase.

  • requires cql3-parser v 0.2.0 to be releases first

@rukai
Copy link
Member

rukai commented Apr 6, 2022

Are you looking for feedback yet?

Theres also a needed rebase/merge.

@Claude-at-Instaclustr
Copy link
Contributor Author

@rukai , I am still trying to ensure that the changes pass the original tests or change the tests in expected ways. I will be reporting that before this gets merged. Yes, I know it need to rebase but I wanted to limit the problems to things I changed from the original code. Rebasing just adds complexity but will be done soon.

@Claude-at-Instaclustr
Copy link
Contributor Author

Code is complete -- or at least as complete as the original main code was.

I added cache documentation as cache.md. There is significant change to caching as it had the deepest hooks into the old SQL based parsing. All original tests pass, though some of the expected results are different.

Cache keys now comprise the fully qualified table name and the primary key. The Redis structure is now a Hash with the hash keys being the base column names (not aliases) from the query as well as any additional WHERE clause components. The items stored in the table is the serialized CassandraResult.

Cache matching then is simply looking up the Redis key table_name:key_seg1:key_seg2:...:key_segN and extracting the hash key col1 col2 col3 ... colN WHERE clause1 AND clause2 AND ... AND clauseN and then deserializing the result as the CassandraResult, setting the id and other tracking info from the result and returning it. The redis key and hash lookup occur in a single Redis call.

@github-actions
Copy link

1 benchmark regressed. 0 benchmark improved. Please check the benchmark workflow logs for full details: https://github.com/shotover/shotover-proxy/actions/runs/2318666400

                        time:   [2.8589 us 2.8602 us 2.8613 us]
                        change: [-0.3537% -0.1421% +0.0571%] (p = 0.18 > 0.05)
                        No change in performance detected.
transform/cassandra_rewrite_peers_passthrough
                        time:   [13.910 us 13.919 us 13.927 us]
                        change: [+69.280% +69.464% +69.653%] (p = 0.00 < 0.05)
                        Performance has regressed.

@rukai
Copy link
Member

rukai commented May 16, 2022

transforms.md still describes the cache as a "write through cache", it should be changed to describe it as a "read behind cache"

@rukai
Copy link
Member

rukai commented Jun 23, 2022

Everything from this PR has been landed in #661

@rukai rukai closed this Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants